package com.zhang.productcenter.manager;

import com.zhang.productcenter.service.IProductBaseService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

@RequiredArgsConstructor
@Slf4j
@Service
public class ProductBaseManager implements IProductBaseManager {

    @Resource
    private IProductBaseService productBaseService;
    @Override
    public void uploadProduct(MultipartFile file, HttpServletResponse response) {
        // 导入
        List<Map<String, Object>> list = productBaseService.importProduct(file);
        // 导出
        productBaseService.downLoad(list, response);
    }

}
